/*
 * Copyright (c) 2024 Huawei Technologies Co., Ltd.
 * openUBMC is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *         http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

#ifndef MC_SCANNER_H
#define MC_SCANNER_H

#include "interface/i_scanner.h"
#include <mc/engine.h>

namespace dev {

class Scanner : public mc::engine::object<Scanner> {
public:
    MC_OBJECT(Scanner, "Scanner", "/bmc/dev/Scanner/${object_name}", (IScanner))

    Scanner()  = default;
    ~Scanner() = default;
    bool init(mc::mutable_dict& csr_object, const mc::dict& connector);
    bool start();
    bool stop();
    bool set_value(uint64_t value);

    IScanner i_scanner;

    // 自定义序列化/反序列化
    static void from_variant(const mc::dict& d, Scanner& obj);

private:
    bool m_initialized = false;
};

} // namespace dev

#endif // MC_SCANNER_H
